﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.Master" AutoEventWireup="true"
    Inherits="Wjtour.Web.Admin.picture.list" %>

<%@ Import Namespace="Wjtour.Domain" %>
<%@ Import Namespace="Wjtour.Common" %>
<%@ Import Namespace="Wjtour.Domain.dto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        ul, li, p
        {
            margin: 0px;
            padding: 0px;
        }

        .picturebox
        {
            clear: both;
        }

            .picturebox ul
            {
                margin: 0px;
                padding: 0px;
            }

                .picturebox ul li
                {
                    float: left;
                    width: 160px;
                    height: 200px;
                    border: 3px solid #808080;
                    padding: 2px 2px 2px 2px;
                    margin: 5px 5px 5px 5px;
                    list-style: none;
                    background-color: #eef2fb;
                }

            .picturebox p
            {
                height: 23px;
                text-align: left;
                padding-left: 10px;
            }

            .picturebox li img
            {
                border: 1px solid #efefef;
            }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <script type="text/javascript">
        function getIds() {
            if ($('#cidselect').val() == 0) {
                alert('没有选择栏目');
                return false;
            }
            var ids = '';
            $('input[name=ids]').each(function () {
                if ($(this).attr('checked') == true) {
                    ids = ids + $(this).attr('id') + ',';
                }
            });
            if (ids == '') {
                alert('没有选择图片');
                return false;
            }
            $('#ids').val(ids);
        }
    </script>
    <table cellspacing="0" width="100%" style="border: 1px  solid #DCEAF7; border-bottom: 0px; background: #E9F2FB;">
        <tr>
            <td width="150px">&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" />&nbsp;
                <%
                    var types = type.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    if (types.Contains("1")
                      || types.Contains("2")
                      || types.Contains("3")
                      || types.Contains("4"))
                    { %>
                <a href="/admin/picture/galleryaddedi.aspx?type=<%=type %>" class="link3">[新增图库]</a>
                <%}
                    else
                    {%>
                <a href="/admin/picture/addedi.aspx?type=<%=type %>" class="link3">[新增图片]</a>
                <%} %>
            </td>
            <td width="" align="right">标题：<asp:TextBox ID="q" runat="server" />&nbsp;<asp:DropDownList ID="cid" runat="server">
                <asp:ListItem Value="0">--顶层栏目--</asp:ListItem>
            </asp:DropDownList>&nbsp;<asp:Button ID="submit" runat="server" Text="提交" />
            </td>
            <td width="150px" align="right">共有 <b>
                <%=data.Pager.TotalRecords%></b> 条记录&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table id="listtable" border="1" cellpadding="0" cellspacing="0" bordercolor="#dddddd">

        <tr>
            <td style="background-color: #e9f2fb">
                <div style="width: 100%" class="picturebox">
                    <ul>
                        <%foreach (Wjtour.Domain.dto.sitepicture_picturetype item in data.Datas)
                          {
                        %>
                        <li>
                            <img src="<%=item.smallImg %>" style="width: 156px; height: 106px;" />

                            <%
                              if (!(types.Contains("1")
                                || types.Contains("2")
                                || types.Contains("3")
                                || types.Contains("4")
                                || types.Contains("5")))
                              { %>
                            <p>
                                <span>图片名称:<a href="addedi.aspx?type=<%=type %>&id=<%=item.id %>"><%=item.picturetitle %></a></span>
                            </p>
                            <%} %>
                            <p>
                                <span>图片类型：<%=item.picturetypename %></span>
                            </p>
                            <%
                              if (types.Contains("1")
                                || types.Contains("2")
                                || types.Contains("3")
                                || types.Contains("4"))
                              { %>
                            <p>
                                <span>所属图库：<a href="/admin/picture/galleryaddedi.aspx?type=<%=type %>&id=<%=item.galleryid %>"><%=item.galleryname %></a></span>
                            </p>
                            <%} %>
                            <p>
                                <input type='checkbox' name='ids' value='<%=item.id %>' id='Checkbox1' />选择
                                <%
                              if (!(types.Contains("1")
                                || types.Contains("2")
                                || types.Contains("3")
                                || types.Contains("4")
                                || types.Contains("5")))
                              { %>
                                <a href="addedi.aspx?type=<%=type %>&id=<%=item.id %>">编辑</a>
                                <%} %>
                                <%if (type == "5")
                                  {
                                      string audit = "";
                                      switch (item.isaudit)
                                      {
                                          case 0:
                                              audit = "<span style='color:red;font-weight:bold'>审核未通过</span>";
                                              break;
                                          case 1:
                                              audit = "<span style='color:#ff6a00'>等待审核</span>";
                                              break;
                                          case 2:
                                              audit = "<span style='color:green;font-weight:bold'>审核通过</span>";
                                              break;
                                          default:
                                              break;
                                      }
                                %><%=audit %><%} %>
                            </p>
                        </li>

                        <%
                          } %>
                    </ul>
                </div>

            </td>
        </tr>
    </table>
    <div style="position: relative; padding-bottom: 10px">
        <input type="hidden" id="delRef" value="<%=delIds.ClientID %>" />
        <input type="hidden" id="auditText" value="<%=auditStatus.ClientID %>" />
        <asp:HiddenField ID="delIds" runat="server" />
        <div style="position: absolute; left: 5px; top: 5px">
            <asp:Button ID="delButton" runat="server" Text="删除" OnClientClick="return delConfirm()" />
            <%if (type == "5")
              {%>
            <asp:Button ID="auditButton" runat="server" Text="审核" OnClientClick="return auditConfirm()" />
            <asp:DropDownList ID="auditStatus" runat="server">
                <asp:ListItem Text="审核未通过" Value="0" />
                <asp:ListItem Text="等待审核" Value="1" />
                <asp:ListItem Text="审核通过" Value="2" />
            </asp:DropDownList>
            <%} %>
        </div>
        <div class="megas512" style="margin-top: 15px;">
            <%=PagerHtml%>
        </div>
    </div>
</asp:Content>
